<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
        <g:set var="entityName" value="${message(code: 'myProfile.label', default: 'My Profile')}" />		
		<title><g:message code="default.edit.label" args="[entityName]" /></title>
	</head>
	<body>
		<div class="nav" role="navigation">
			<ul>
                <li><g:link class="show" action="show"><g:message code="default.show.label" args="[entityName]" /></g:link></li>				
			</ul>
		</div>
		<div id="edit-my-profile" class="content scaffold-edit" role="main">
			<h1><g:message code="default.edit.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<g:hasErrors bean="${myProfile}">
			<ul class="errors" role="alert">
				<g:eachError bean="${myProfile}" var="error">
				<li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
				</g:eachError>
			</ul>
			</g:hasErrors>
			<g:form method="post" >
				<fieldset class="form">
                    
                    <div class="fieldcontain ${hasErrors(bean: myProfile, field: 'kindleAccount', 'error')} required">
                        <label for="kindleAccount">
                            <g:message code="myProfile.kindleAccount.label" default="Kindle account" />
                            <span class="required-indicator">*</span>
                        </label>
                        <g:textField name="kindleAccount" required="" value="${myProfile?.kindleAccount}"/>
                    </div>
                    
					<div class="fieldcontain ${hasErrors(bean: myProfile, field: 'timeZone', 'error')} required">
                        <label for="timeZone">
                            <g:message code="myProfile.timeZone.label" default="Time zone" />
                            <span class="required-indicator">*</span>
                        </label>
                        <g:select name="timeZone" from="${availableTimeZones}"  value="${myProfile.timeZone}" class="one-to-many"/> 
                    </div>
					
				</fieldset>
				<fieldset class="buttons">
					<g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" />
				</fieldset>
			</g:form>
		</div>
	</body>
</html>
